package leetcode.code;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public class Solution389 implements IDebug {

	public char findTheDifference(String s, String t) {
		int[] dic = new int[26];
		for (char c : s.toCharArray()) {
			dic[c - 'a']++;
		}
		for (char c : t.toCharArray()) {
			dic[c - 'a']--;
		}
		for (int i = 0; i < dic.length; i++) {
			if (dic[i] == -1) {
				return (char) (i + 'a');
			}
		}
		return ' ';
	}

	@Override
	public void debug1() {
		String s = "abcd";
		String t = "abcde";
		char e = 'e';
		char r = this.findTheDifference(s, t);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution389 so = new Solution389();
		so.debug1();

	}

}
